package com.itheima.mapper;

import com.itheima.pojo.Dept;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DeptMapper {

//    @Results({
//            @Result(column = "create_time",property="createTime"),
//            @Result(column = "update_time",property="updateTime")
//    })

//    @Select("SELECT dept.id, dept.name, dept.create_time createtime, dept.update_time updatetime from dept order by update_time desc ")
    @Select("SELECT dept.id, dept.name, dept.create_time, dept.update_time from dept order by update_time desc ")

    List<Dept> findAll();
}
